package com.itheima.d09_abstract_use;

/**
 * 宠物类：父类
 *       作用一：作为父类，设计出更合理的父类
 *       作用二：更好的支持多态
 */
public abstract class Animal {

    private  String name;


    public  abstract void cry();


    public Animal() {
    }

    public Animal(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                '}';
    }
}
